package com.tcm.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.tcm.entity.Clazz;
import com.tcm.entity.dto.param.ClazzPageParam;
import com.tcm.entity.dto.ClazzUpdateDto;
import com.tcm.entity.vo.ClazzListResult;
import com.tcm.entity.vo.ClazzSelectResult;
import com.tcm.entity.resp.PageR;
import com.tcm.exception.DatabaseOperationException;
import com.tcm.exception.EntityInvalidException;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author Guqier
 * @version 1.0
 * @date 2023/7/2 17:25
 */
public interface ClazzService extends IService<Clazz> {

    @Transactional
    boolean addClazzInfo(ClazzUpdateDto clazzInfo, Long currUserId) throws EntityInvalidException;

    PageR<ClazzListResult> getClazzListByPage(ClazzPageParam clazzPageParam);

    @Transactional
    boolean modifyClazzInfo(ClazzUpdateDto clazzUpdateDto, Long currUserID) throws EntityInvalidException;

    @Transactional
    boolean removeClazzInfo(List<String> ids, Long currUserId) throws DatabaseOperationException;

    List<ClazzSelectResult> getClazzListAccordingToTeacher(Long teacherUserId);
}
